(function ($) {

    $.fn.hoverfold = function (args) {

        this.each(function () {

            $(this).children('.view').each(function () {

                var $item = $(this),
                    img = $item.children('img').attr('src'),
                    struct = '<div class="slice s1">';
                struct += '<div class="slice s2">';
                struct += '<div class="slice s3">';
                struct += '<div class="slice s4">';
                struct += '</div>';
                struct += '</div>';
                struct += '</div>';
                struct += '</div>';

                var $struct = $(struct);

                $item.find('img').remove().end().append($struct).find('div.slice').css('background-image', 'url(' + img + ')').prepend($('<span class="overlay" ></span>'));

            });

        });

    };

})(jQuery);